export default [
  // 权限路由
  {
    path: '/',
    redirect: '/survey',
    hidden: true // 是否展示在侧边栏的菜单里
  },
  // 数据概览
  {
    path: '/survey',
    component: 'Layout',
    redirect: '/survey/agent',
    meta: {
      menuName: 'Survey', // 一级菜单标题
      icon: 'icon-caiwu' // 一级菜单的图标
    },
    children: [{
      path: 'agent',
      name: 'Survey',
      component: '/survey/agent',
      meta: {
        refresh: false,
        title: '', // 页面头部的标题
        isOnly: true, // 单独页面
        auth: [], // 单独页面按钮操作权限
        pagePermission: [{
          title: 'Survey',
          index: 0,
          auth: ['pagedata', 'export']
        }]
      }
    }]
  },
  //  技师管理
  {
    path: '/technician',
    component: 'Layout',
    redirect: '/technician/list',
    meta: {
      menuName: 'Technician',
      icon: 'iconshenqingjishi3'
    },
    children: [{
      path: 'list',
      name: 'TechnicianManage',
      component: '/technician/list',
      meta: {
        keepAlive: true,
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'TechnicianManage',
          index: 0,
          auth: ['pagedata', 'add', 'edit']
        }]
      }
    }, {
      path: 'edit',
      name: 'TechnicianEdit',
      component: '/technician/edit',
      hidden: true,
      meta: {
        keepAlive: false,
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'TechnicianEdit',
          index: 0,
          auth: []
        }]
      }
    }]
  },
  // 服务管理
  {
    path: '/service',
    component: 'Layout',
    redirect: '/service/list',
    meta: {
      menuName: 'Service',
      icon: 'icon-yuyue',
      subNavName: [{
        name: 'ServiceManage',
        url: [{
          name: 'ServiceManage',
          url: '/service/list'
        }, {
          name: 'ServiceBell',
          url: '/service/bell'
        }, {
          name: 'ServiceExamine',
          url: '/service/examine'
        }]
      }]
    },
    children: [{
      path: 'list',
      name: 'ServiceManage',
      component: '/service/service/list',
      meta: {
        keepAlive: true,
        title: 'ServiceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ServiceManage',
          index: 0,
          auth: ['pagedata', 'add', 'edit', 'delete']
        }]
      }
    }, {
      path: 'service/edit',
      name: 'ServiceEdit',
      component: '/service/service/edit',
      hidden: true,
      meta: {
        title: 'ServiceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ServiceEdit',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'bell',
      name: 'ServiceBell',
      component: '/service/bell/list',
      meta: {
        keepAlive: true,
        title: 'ServiceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ServiceBell',
          index: 0,
          auth: ['pagedata', 'add', 'edit', 'delete']
        }]
      }
    }, {
      path: 'bell/edit',
      name: 'ServiceBellEdit',
      component: '/service/bell/edit',
      hidden: true,
      meta: {
        title: 'ServiceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ServiceBellEdit',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'examine',
      name: 'ServiceExamine',
      component: '/service/service/agent-examine',
      meta: {
        keepAlive: true,
        title: 'ServiceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ServiceExamine',
          index: 0,
          auth: ['pagedata', 'edit', 'delete']
        }]
      }
    }]
  },
  //  订单管理
  {
    path: '/shop',
    component: 'Layout',
    redirect: '/shop/order/list',
    meta: {
      menuName: 'Shop',
      icon: 'icon-dingdanguanli',
      subNavName: [{
        name: 'ShopOrderManage',
        url: [{
          name: 'ShopOrder',
          url: '/shop/order/list'
        }, {
          name: 'ShopBellOrder',
          url: '/shop/order/bell'
        }, {
          name: 'ShopRefuseOrder',
          url: '/shop/order/refuse'
        }, {
          name: 'ShopRefund',
          url: '/shop/refund/list'
        }, {
          name: 'ShopBellRefund',
          url: '/shop/refund/bell'
        }]
      }, {
        name: 'ShopEvaluate',
        url: [{
          name: 'ShopEvaluate',
          url: '/shop/evaluate/list'
        }]
      }]
    },
    children: [{
      path: 'order/list',
      name: 'ShopOrder',
      component: '/shop/order/list',
      meta: {
        keepAlive: true,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopOrder',
          index: 0,
          auth: ['pagedata', 'view', 'print', 'export', 'transferOrder', 'orderTaking', 'setOut', 'arrive', 'startService', 'serviceCompletion']
        }]
      }
    }, {
      path: 'order/bell',
      name: 'ShopBellOrder',
      component: '/shop/order/bell',
      meta: {
        keepAlive: true,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopBellOrder',
          index: 0,
          auth: ['pagedata', 'view', 'print', 'export', 'orderTaking', 'startService', 'serviceCompletion']
        }]
      }
    }, {
      path: 'order/refuse',
      name: 'ShopRefuseOrder',
      component: '/shop/order/refuse',
      meta: {
        keepAlive: true,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopRefuseOrder',
          index: 0,
          auth: ['pagedata', 'view', 'transferOrder', 'agreeRefund']
        }]
      }
    }, {
      path: 'order/detail',
      name: 'ShopOrderDetail',
      component: '/shop/order/detail',
      hidden: true,
      meta: {
        keepAlive: false,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopOrderDetail',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'refund/list',
      name: 'ShopRefund',
      component: '/shop/refund/list',
      meta: {
        keepAlive: true,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopRefund',
          index: 0,
          auth: ['pagedata', 'view', 'agreeRefund', 'rejectRefund']
        }]
      }
    }, {
      path: 'refund/bell',
      name: 'ShopBellRefund',
      component: '/shop/refund/bell',
      meta: {
        keepAlive: true,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopBellRefund',
          index: 0,
          auth: ['pagedata', 'view', 'agreeRefund', 'rejectRefund']
        }]
      }
    }, {
      path: 'refund/detail',
      name: 'ShopRefundDetail',
      component: '/shop/refund/detail',
      hidden: true,
      meta: {
        keepAlive: false,
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopRefundDetail',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'evaluate/list',
      name: 'ShopEvaluate',
      component: '/shop/evaluate/list',
      meta: {
        title: 'ShopOrderManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ShopEvaluate',
          index: 0,
          auth: ['pagedata', 'add', 'delete']
        }]
      }
    }]
  },
  // 业务员管理
  {
    path: '/salesman',
    component: 'Layout',
    redirect: '/salesman/examine',
    meta: {
      menuName: 'Salesman',
      icon: 'icon-account-line',
      subNavName: [{
        name: 'SalesmanManage',
        url: [{
          name: 'SalesmanExamine',
          url: '/salesman/examine'
        }, {
          name: 'SalesmanCount',
          url: '/salesman/count'
        }]
      }]
    },
    children: [{
      path: 'examine',
      name: 'SalesmanExamine',
      component: '/salesman/examine',
      meta: {
        title: 'SalesmanManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'SalesmanExamine',
          index: 0,
          auth: ['pagedata', 'view', 'delete', 'authSalesman', 'cancelAuth', 'resetAuth', 'bindChannel', 'resetSalesman', 'deleteChannel']
        }]
      }
    }, {
      path: 'count',
      name: 'SalesmanCount',
      component: '/salesman/count',
      meta: {
        keepAlive: true,
        title: 'SalesmanManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'SalesmanCount',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'channel',
      name: 'SalesmanChannel',
      component: '/salesman/channel',
      hidden: true,
      meta: {
        title: 'SalesmanManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'SalesmanChannel',
          index: 0,
          auth: []
        }]
      }
    }]
  },
  // 渠道商管理
  {
    path: '/channel',
    component: 'Layout',
    redirect: '/channel/examine',
    meta: {
      menuName: 'Channel',
      icon: 'iconwoshiqudaoshang',
      subNavName: [{
        name: 'ChannelManage',
        url: [{
          name: 'ChannelExamine',
          url: '/channel/examine'
        }, {
          name: 'ChannelFinance',
          url: '/channel/finance'
        }]
      }, {
        name: 'ChannelQrManage',
        url: [{
          name: 'ChannelQr',
          url: '/channel/qr'
        }, {
          name: 'ChannelQrCount',
          url: '/channel/count'
        }]
      }]
    },
    children: [{
      path: 'examine',
      name: 'ChannelExamine',
      component: '/channel/examine',
      meta: {
        title: 'ChannelManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ChannelExamine',
          index: 0,
          auth: ['pagedata', 'view', 'edit', 'delete', 'authChannel', 'cancelAuth', 'resetAuth', 'updateAgentSalesman', 'setChannelBalance', 'delChannelBalance']
        }]
      }
    }, {
      path: 'finance',
      name: 'ChannelFinance',
      component: '/channel/finance',
      meta: {
        title: 'ChannelManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ChannelFinance',
          index: 0,
          auth: ['pagedata', 'print', 'export']
        }]
      }
    }, {
      path: 'qr',
      name: 'ChannelQr',
      component: '/channel/qr',
      meta: {
        title: 'ChannelManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ChannelQr',
          index: 0,
          auth: ['pagedata', 'add', 'edit', 'delete', 'downloadQr', 'batchDownloadQr', 'batchDelete', 'batchBindChannel']
        }]
      }
    }, {
      path: 'count',
      name: 'ChannelQrCount',
      component: '/channel/count',
      meta: {
        title: 'ChannelManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'ChannelQrCount',
          index: 0,
          auth: []
        }]
      }
    }]
  },
  //  财务管理
  {
    path: '/finance',
    component: 'Layout',
    redirect: '/finance/commission',
    meta: {
      menuName: 'Finance',
      icon: 'icon-caiwu',
      subNavName: [{
        name: 'FinanceManage',
        url: [{
          name: 'FinanceCommission',
          url: '/finance/commission'
        }, {
          name: 'FinanceRecord',
          url: '/finance/record'
        }, {
          name: 'FinanceSheet',
          url: '/finance/sheet'
        }]
      }]
    },
    children: [{
      path: 'commission',
      name: 'FinanceCommission',
      component: '/finance/finance/commission',
      meta: {
        title: 'FinanceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'FinanceCommission',
          index: 0,
          auth: ['pagedata', 'cashOut']
        }]
      }
    }, {
      path: 'record',
      name: 'FinanceRecord',
      component: '/finance/finance/record',
      meta: {
        keepAlive: false,
        title: 'FinanceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'FinanceRecord',
          index: 0,
          auth: ['pagedata', 'export', 'wechatCashOut', 'alipayCashOut', 'adapayCashOut', 'underlineCashOut', 'rejectCashOut']
        }]
      }
    }, {
      path: 'sheet',
      name: 'FinanceSheet',
      component: '/finance/finance/sheet',
      meta: {
        title: 'FinanceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'FinanceSheet',
          index: 0,
          auth: ['pagedata', 'export']
        }]
      }
    }, {
      path: 'adapay',
      name: 'FinanceAdapay',
      component: '/finance/finance/adapay',
      meta: {
        title: 'FinanceManage',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'FinanceAdapay',
          index: 0,
          auth: []
        }]
      }
    }]
  },
  // 门店
  {
    path: '/store',
    component: 'Layout',
    redirect: '/store/list',
    meta: {
      menuName: 'Store',
      icon: 'iconshangjia'
    },
    children: [{
      path: 'list',
      name: 'StoreList',
      component: '/store/list/list',
      meta: {
        keepAlive: true,
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'StoreList',
          index: 0,
          auth: ['pagedata', 'edit']
        }]
      }
    }, {
      path: 'list/edit',
      name: 'StoreEdit',
      component: '/store/list/edit',
      meta: {
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'StoreEdit',
          index: 0,
          auth: []
        }]
      }
    }]
  },
  // 求救通知
  {
    path: '/notice',
    component: 'Layout',
    redirect: '/notice/list',
    meta: {
      menuName: 'Notice',
      icon: 'icon-tongzhi'
    },
    children: [{
      path: 'list',
      name: 'NoticeList',
      component: '/notice/list',
      meta: {
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'NoticeList',
          index: 0,
          auth: ['pagedata', 'read', 'delete']
        }]
      }
    }]
  },
  //  订单通知
  {
    path: '/order',
    component: 'Layout',
    redirect: '/order/notice',
    isHidden: true,
    meta: {
      menuName: 'ShopOrderNotice',
      icon: 'icon-tongzhi'
    },
    children: [{
      path: 'notice',
      name: 'ShopOrderNoticeList',
      component: '/shop/notice',
      meta: {
        keepAlive: true,
        title: '',
        auth: [],
        isOnly: true,
        pagePermission: [{
          title: 'ShopOrderNoticeList',
          index: 0,
          auth: ['pagedata', 'read', 'delete']
        }]
      }
    }]
  },
  // 权限管理
  {
    path: '/account',
    component: 'Layout',
    redirect: '/account/phone',
    meta: {
      menuName: 'Account',
      icon: 'icon-account'
    },
    children: [{
      path: 'phone',
      name: 'AccountPhone',
      component: '/account/phone',
      meta: {
        title: '',
        auth: [],
        isOnly: false,
        pagePermission: [{
          title: 'AccountPhone',
          index: 0,
          auth: ['pagedata', 'add', 'edit', 'delete']
        }]
      }
    }]
  },
  // 代理商
  {
    path: '/agent',
    component: 'Layout',
    redirect: '/agent/fdd/set',
    meta: {
      menuName: 'AgentFdd',
      icon: 'iconhetongguanli',
      subNavName: [{
        name: 'AgentFddManage',
        url: [{
          name: 'AgentFddSet',
          url: '/agent/fdd/set'
        }, {
          name: 'AgentFddRecord',
          url: '/agent/fdd/record'
        }]
      }]
    },
    children: [{
      path: 'fdd/set',
      name: 'AgentFddSet',
      component: '/agent/fdd/set',
      meta: {
        title: 'AgentFdd',
        auth: [],
        isOnly: true,
        pagePermission: [{
          title: 'AgentFddSet',
          index: 0,
          auth: []
        }]
      }
    }, {
      path: 'fdd/record',
      name: 'AgentFddRecord',
      component: '/agent/fdd/record',
      meta: {
        keepAlive: true,
        title: 'AgentFdd',
        auth: [],
        isOnly: true,
        pagePermission: [{
          title: 'AgentFddRecord',
          index: 0,
          auth: ['pagedata', 'toFddSign', 'fddSignUrl', 'fddMerchantSign', 'delete']
        }]
      }
    }]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]
